onLoad(function() {
    // 遍历所有的图片， 查找data-rollover属性
    for (let i = 0; i < document.images.length; i++) {
        var img = document.images[i];
        var rollover = img.getAttribute("data-rollover");
        if(!rollover) { continue }
        (new Image()).src = rollover;
        // 定义一个属性来标识默认的图片URL
        // 注册事件处理函数来创建翻转效果
        img.onmouseover = function() {
            this.src = this.getAttribute("data-rollover");
        };
        img.onmouseout = function(){
            this.src = this.getAttribute("data-rollout");
        }
        
    }
})